#!/bin/bash

if [[ $# -ne 1 ]]; then
    echo "The format is as follows:"
    echo "bash matplotlib-1.4.0.sh installpath"
    echo ":param installpath: 应用安装绝对路径"
    exit 1
fi

[[ ! "$1" =~ ^/.* || ! -d "$1" || "$1" = "/" ]] &&  echo "请输入正确的安装路径" && exit 1

installpath=$1
[[ "$installpath" =~ .*/$ ]] && installpath=${installpath%/*}

set -e
yum install -y wget tar environment-modules libatomic  

$installpath/python-2.7.18/bin/pip install -i https://pypi.tuna.tsinghua.edu.cn/simple matplotlib==1.4.0